{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 笔记\n",
    "这个笔记主要是用来记录一些NinaPro数据集分析的过程。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### NinaPro数据分析\n",
    "~5/4 首先下载了DB9~\n",
    "5/5 DB9并不包括emg数据，重新下载了DB8  \n",
    "<font color=\"#dd0000\">注意11和12号数据为残疾人数据，训练时可以抛去</font><br />\n",
    "下文描述了部分会用到的数据集的格式和内容。对于每个主题和练习，数据库都包含一个。带有同步变量的mat文件。文件中包含的变量包括：  \n",
    "+ emg（16列）：sEMG signals from the 16 sensors\n",
    "+ exercise 运动：运动标号；(value set to 1 in all data files)\n",
    "+ subject 测试号：测试编号；\n",
    "+ glove 手套（18列）：calibrated signals from the 18 sensors of the Cyberglove\n",
    "+ restimulus再刺激（1列）：运动的后验精炼标签；\n",
    "+ rerepetition采集重复（1列）：重复采集某动作的index； \n",
    "其中rerepetition和restimulus都是经过矫正后的数据，毕竟在采集过程中总会存在人的反应时间和软件延迟的影响。  \n",
    "\n",
    "The variables included in the .mat files are the following:\n",
    "+ subject: subject number\n",
    "+ exercise: exercise number (value set to 1 in all data files)\n",
    "+ emg (16 columns): sEMG signals from the 16 sensors\n",
    "+ acc (48 columns): three-axis accelerometer data from the 16 sensors\n",
    "+ gyro (48 columns): three-axis gyroscope data from the 16 sensors\n",
    "+ mag (48 columns): three-axis magnetometer data from the 16 sensors\n",
    "+ glove (18 columns): calibrated signals from the 18 sensors of the Cyberglove\n",
    "+ stimulus (1 column): the movement repeated by the subject\n",
    "+ restimulus (1 column): again the movement repeated by the subject. In this case, the duration of the movement label is refined a-posteriori in order to correspond to the real movement.\n",
    "+ repetition (1 column): repetition number of the stimulus\n",
    "+ rerepetition (1 column): repetition number of restimulus\n",
    "\n",
    "许多因素会影响传感器信号的振幅，包括采集设置、受试者的解剖特征和疲劳等。\n",
    "由于噪声问题，传感器11（对应于MCP2-3_A）未包含在校准数据中。\n",
    "当受试者手部尺寸较大时（即手套与手部合适时），倾角传感器提供可靠的角度。取而代之的是，当受试者的手很小时，测试可能会提供部分结果。因此，在使用他们的信息时应予以注意。\n",
    "\n",
    "<font color=\"#dd0000\">另外sEMG信号采样率为1111Hz，但是被上采样至2kHz  而DB8中的手套数据均为右手数据</font><br />\n",
    "### mat文件分析及使用：\n",
    "我打算用sEMG_CNN_LSTM这个项目的脚本来分析mat文件。  \n",
    "\n",
    "不过好像不太好用  \n",
    "\n",
    "尝试 import scipy.io  \n",
    "\n",
    "重写分析脚本\n",
    "首先原始数据集太大了，包括很多不需要的数据，提取出emg exercise subject glove restimulus 和rerepetition数据即可  \n",
    "以下是截取用的代码。 22G->8G 爽了。\n",
    "<font color=\"#dd0000\" size=5>数据集比较大，硬盘速度严重限制处理速度，建议在ssd内操作</font><br />"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "import matplotlib.pyplot as plt\n",
    "import os\n",
    "from torch.utils.data import Dataset\n",
    "import torch\n",
    "\n",
    "dataDir='./EMG_data/NinaProDB8/'\n",
    "saveDir='./EMG_data/splitDB8/'\n",
    "newData={}\n",
    "def findAllMat():\n",
    "    \"\"\"\n",
    "    @description  :找到dataDir下所有的mat文件\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    for root,dirs,files in os.walk(dataDir):\n",
    "        for f in files:\n",
    "            if(f.split('.')[-1]==\"mat\"):\n",
    "                yield f\n",
    "\n",
    "def rwMat(mData,name):\n",
    "    \"\"\"\n",
    "    @description  :读取并生成mat文件\n",
    "    ---------\n",
    "    @param  :mData mat数据\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    newData.clear()\n",
    "    newData['emg'] = mData['emg']\n",
    "    newData['exercise'] = mData['exercise']\n",
    "    newData['subject'] = mData['subject']\n",
    "    newData['glove'] = mData['glove']\n",
    "    newData['restimulus'] = mData['restimulus']\n",
    "    newData['rerepetition'] = mData['rerepetition']\n",
    "    sio.savemat(saveDir+name, newData)\n",
    "\n",
    "#ssd下大概需要3min \n",
    "for matFile in findAllMat(): \n",
    "    matData=sio.loadmat(dataDir+matFile)\n",
    "    rwMat(matData,matFile)\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "查阅了NinaPro的原始论文，ps：他们的官网是真的烂，图片没显示，害我找了好久。[论文原文](NinaPro论文.pdf)  \n",
    "另外使用了DB9论文中的角度换算[论文原文](手套数据角度转换论文.pdf)  \n",
    "这篇论文作者是西班牙人，一些数据用西语备注 比如mseg 代表毫秒。\n",
    "尝试使用这个转换DB8中的手套数据，并使用UE4进行可视化。  \n",
    "转换脚本所需的数据格式为  \n",
    "1:time 2:CMC1_roll 3:MCP1 4:IP1 5:Abd_1-2  \n",
    "6:MCP2 7:PIP2 8:DIP2 9:--  \n",
    "10:MCP3 11:PIP3 12:DIP3 13:Abd_2-3  \n",
    "14:MCP4 15:PIP4 16:DIP4 17:Abd_3-4  \n",
    "18:MCP5 19:PIP5 20:DIP5 21:Abd_4-5  \n",
    "22:Palm_arch 23:Wrist_F 24:Wrist_A 25:--  \n",
    "备注： MCP metacarpophalangeal指掌 PIP中间的指节 DIP指尖指节 abd为指间的传感器 -- 填0即可 Palm_arch=CMC5  \n",
    "其中8 12 16 20 这4个数据DB8中没有，因为DB使用18sensor的手套，填充0即可。\n",
    "转换后对应的joint为  \n",
    "<font color=\"#dd0000\">标号和手套标点并不对应！实际映射关系如下</font><br />  \n",
    "| sensor | 1 | 2 | 3 | 4 | 5 | 6 | 7  | 8  | 9  | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |\n",
    "|:------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n",
    "| NUM    | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 13 | 14 | 15 | 17 | 18 | 19 | 21 | 22 | 23 | 24 |\n",
    "\n",
    "'L_CMC1_F','L_CMC1_A','L_MCP1_F','L_IP1_F','L_MCP2_F','L_MCP2_A','L_PIP2_F','L_MCP3_F','L_PIP3_F','L_MCP4_F','L_MCP4_A','L_PIP4_F','L_PalmArch_F','L_MCP5_F','L_MCP5_A','L_PIP5_F','L_DIP2','L_DIP3','L_DIP4','L_DIP5','L_WR_F','L_WR_A'  \n",
    "<img src=\"pic/转换后的joint.jpg\" width=\"20%\" align=left><img src=\"pic/glove.jpg\" width=\"20%\" align=left>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\" matFile='S1_E1_A1.mat'\\nmatData=sio.loadmat(matFile)\\ndata_angles = matData['angles'] \\ndata_exercise = matData['exercise']\\ndata_glove = matData['glove']\\ndata_order_of_angles = matData['order_of_angles']\\ndata_subject = matData['subject']\\n#print(matData)\\nprint(data_angles,'\\n',data_angles.shape)\\nprint(data_exercise,'\\n',data_exercise.shape)\\nprint(data_glove,'\\n',data_glove.shape)\\nprint(data_order_of_angles,'\\n',data_order_of_angles.shape)\\nprint(data_subject,'\\n',data_subject.shape) \""
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "import matplotlib.pyplot as plt\n",
    "import os\n",
    "from torch.utils.data import Dataset\n",
    "import torch\n",
    "dataDir = './EMG_data/splitDB8/'\n",
    "saveDir = './EMG_data/txt/'\n",
    "\n",
    "def readMat(mData, name):\n",
    "    \"\"\"\n",
    "    @description  :读取并处理mat文件，创建txt文档按格式保存glove数据\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    foo=[]\n",
    "    time=0\n",
    "    data_glove = mData['glove']\n",
    "    name = name.split('.')[0]\n",
    "    S = name.split('_')[0][1:]  #受试者序号\n",
    "    A = name.split('_')[-1][1:]  #实验分组，共3组 其中1 2组用于训练 3组用于验证\n",
    "    with open(\n",
    "            saveDir + \"test_\" + str((int(A) - 1) * 10 + int(S)) + \"_CGL_Cable.txt\",\n",
    "            \"w\") as op:  #前10为10个受试者的第一组数据，以此类推\n",
    "        op.write(\n",
    "            \"Hora de inicio de la toma de datos: 00:00:00\\nAT(s) ROLL1(udig) MCF1 IFD1 A1 MCF2 IFP2 IFD2(*) A2(**) MCF3 IFP3 IFD3(*) A3 MCF4 IFP4 IFD4(*) A4 MCF5 IFP5 IFD5(*) A5 ROLL5 C C_Ano usado\\n\"\n",
    "        )#没啥意义，占两行并满足脚本运行需求。\n",
    "        for i in data_glove:\n",
    "            list_i=i.tolist()\n",
    "            foo.clear()\n",
    "            time+=0.001         #实际应该为0.0005，不过只是占位所以无所谓\n",
    "            foo=[time]+list_i[0:6]+[0,0]+list_i[6:8]+[0]+list_i[8:11]+[0]+list_i[11:14]+[0]+list_i[14:]+[0]\n",
    "            mid_np = np.array(foo)\n",
    "            mid_np_2f = np.round(mid_np,3)\n",
    "            foo=mid_np_2f.tolist()\n",
    "            foo=list(map(str,foo))\n",
    "            op.write(' '.join(foo)+'\\n')    \n",
    "        op.close()\n",
    "    #print(data_glove, '\\n', data_glove.shape)\n",
    "\n",
    "\n",
    "for matFile in findAllMat():\n",
    "    matData = sio.loadmat(dataDir + matFile)\n",
    "    readMat(matData, matFile)\n",
    "\n",
    "\"\"\" matFile='S1_E1_A1.mat'\n",
    "matData=sio.loadmat(matFile)\n",
    "data_angles = matData['angles'] \n",
    "data_exercise = matData['exercise']\n",
    "data_glove = matData['glove']\n",
    "data_order_of_angles = matData['order_of_angles']\n",
    "data_subject = matData['subject']\n",
    "#print(matData)\n",
    "print(data_angles,'\\n',data_angles.shape)\n",
    "print(data_exercise,'\\n',data_exercise.shape)\n",
    "print(data_glove,'\\n',data_glove.shape)\n",
    "print(data_order_of_angles,'\\n',data_order_of_angles.shape)\n",
    "print(data_subject,'\\n',data_subject.shape) \"\"\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "测完了，试着用转换脚本得到了一些数据，帮他改了一些bug，然而，发现数据不能用，参考系不明确，试着输入opensim，但是数据并不能用，反正很离谱。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\ProgramData\\Miniconda3\\lib\\site-packages\\tqdm\\auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
      "  from .autonotebook import tqdm as notebook_tqdm\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "./EMG_data/S10_E1_A3.mat\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "import matplotlib.pyplot as plt\n",
    "import os\n",
    "from torch.utils.data import Dataset\n",
    "import torch\n",
    "dataDir='./EMG_data/test/'\n",
    "saveDir='./EMG_data/'\n",
    "newData={}\n",
    "def findAllMat():\n",
    "    \"\"\"\n",
    "    @description  :找到dataDir下所有的mat文件\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    for root,dirs,files in os.walk(dataDir):\n",
    "        for f in files:\n",
    "            if(f.split('.')[-1]==\"mat\"):\n",
    "                yield f\n",
    "def rwMat2(mData,name):\n",
    "    \"\"\"\n",
    "    @description  :读取并生成mat文件\n",
    "    ---------\n",
    "    @param  :mData mat数据\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    newData.clear()\n",
    "    newData['emg'] = mData['emg'][:20000,]\n",
    "    newData['glove'] = mData['glove'][:20000,]\n",
    "    print(saveDir+name)\n",
    "    sio.savemat(saveDir+name, newData)\n",
    "\n",
    "#重写rwmat，截取前20000个数据\n",
    "for matFile in findAllMat(): \n",
    "    matData=sio.loadmat(dataDir+matFile)\n",
    "    rwMat2(matData,matFile)\n",
    "    break"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 开始写LTSM了  \n",
    "## 首先是dataset，由于本项目属于many to many，而且数据集不是标准格式，所以自定义一个dataLoader。  \n",
    "以下是实现代码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "class MyDataSet(Dataset):\n",
    "    def __init__(self, file_path):\n",
    "        super(MyDataSet, self).__init__()\n",
    "        self.matData = sio.loadmat(file_path)  #读取mat文件\n",
    "\n",
    "    def __getitem__(self, index):\n",
    "        data= torch.Tensor(self.matData['emg'][index,])\n",
    "        label=torch.Tensor(self.matData['glove'][index,])\n",
    "        return data,label\n",
    "\n",
    "    def __len__(self):\n",
    "        return len(self.matData['emg'])\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    fpath='./EMG_data/test/'\n",
    "    for f in findAllMat(fpath):\n",
    "        test=MyDataSet(fpath+f)\n",
    "        mydata=test.__len__()\n",
    "        print(mydata)\n",
    "        break"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 损失函数  \n",
    "由于每个output_channel都是独立的关节运动选择均方损失函数且不缩减维度。  \n",
    "crit =torch.nn.MSELoss(reduction='none')  \n",
    "### 优化器\n",
    "Pytorch中有四种常用的优化器，SGD、Momentum、RMSProp、Adam。  \n",
    "下面引入大佬分析  [链接](https://blog.csdn.net/sinat_38079265/article/details/121442523)  \n",
    "综合考虑之后， \n",
    "选了比较适合RNN的RMSProp  \n",
    "- [ ] 也可以试试Adam的效果\n",
    "全局学习率调整策略，使用自适应调整学习率 ReduceLROnPlateau"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5/9 问题更新\n",
    "发现并不收敛，大佬给的网络虽然loss偏低，但是也不收敛，怀疑数据有问题，首先数据是上采样过的经过nearest插值，glove数据更新的非常慢，导致在一个滑窗范围内emg数据虽然跳动，但无法影响glove。决定对glove数据进行线性插值。  \n",
    "下面是线性插值代码。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:41:30 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 1.2341853e-06,  3.8402291e-06,  4.0789485e-07, ...,\n",
      "        -5.8135051e-06,  7.0173263e-07,  2.3116690e-06],\n",
      "       [ 5.1234446e-07,  1.7048582e-06, -3.6002081e-07, ...,\n",
      "        -4.8401321e-06,  3.6570910e-07,  7.0946015e-07],\n",
      "       [ 1.5461777e-06,  1.4316336e-06, -1.8307417e-06, ...,\n",
      "        -4.5087581e-06, -7.6896461e-10,  1.4106100e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[10]], dtype=uint8), 'glove': array([[37.21017   , 13.375127  , 27.798767  , ..., 32.84767   ,\n",
      "         9.394789  ,  2.6951935 ],\n",
      "       [37.21017   , 13.375127  , 27.798767  , ..., 32.84767   ,\n",
      "         9.394789  ,  2.6951935 ],\n",
      "       [37.21017   , 13.375127  , 27.798767  , ..., 32.84767   ,\n",
      "         9.394789  ,  2.6951935 ],\n",
      "       ...,\n",
      "       [-6.352956  ,  5.851618  , 41.69815   , ..., 30.240713  ,\n",
      "         4.4501634 , -0.22459945],\n",
      "       [-6.352956  ,  5.851618  , 41.69815   , ..., 30.240713  ,\n",
      "         4.4501634 , -0.22459945],\n",
      "       [-6.352956  ,  5.851618  , 41.69815   , ..., 30.240713  ,\n",
      "         4.4501634 , -0.22459945]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S10_E1_A1.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:41:36 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-8.1899674e-07, -4.0694240e-06, -1.4614074e-06, ...,\n",
      "        -1.8249448e-06,  1.2720431e-06, -3.5504922e-06],\n",
      "       [-1.5623804e-07, -1.1981384e-05, -1.8934845e-06, ...,\n",
      "        -5.3140902e-06,  3.1152508e-06, -6.1712439e-07],\n",
      "       [ 8.1380313e-07, -1.0912284e-05, -2.0859302e-06, ...,\n",
      "        -4.3699110e-06,  4.0867772e-06, -1.7249921e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[10]], dtype=uint8), 'glove': array([[52.63878  , 19.226746 , 27.798767 , ..., 29.19793  ,  4.944626 ,\n",
      "         1.7967956],\n",
      "       [52.63878  , 19.226746 , 27.798767 , ..., 29.19793  ,  4.944626 ,\n",
      "         1.7967956],\n",
      "       [52.63878  , 19.226746 , 27.798767 , ..., 29.19793  ,  4.944626 ,\n",
      "         1.7967956],\n",
      "       ...,\n",
      "       [ 2.7226954,  0.8359454, 40.062927 , ..., 58.91725  ,  5.933551 ,\n",
      "         2.6951935],\n",
      "       [ 2.7226954,  0.8359454, 40.062927 , ..., 58.91725  ,  5.933551 ,\n",
      "         2.6951935],\n",
      "       [ 2.7226954,  0.8359454, 40.062927 , ..., 58.91725  ,  5.933551 ,\n",
      "         2.6951935]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S10_E1_A2.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:41:37 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 1.1006539e-05, -1.5316144e-05, -1.0417150e-06, ...,\n",
      "         5.5386563e-06, -1.6369262e-06,  4.1063804e-06],\n",
      "       [ 8.2039169e-06,  1.9665349e-05, -5.8873104e-07, ...,\n",
      "         3.8605694e-06, -1.8218612e-06,  2.2802783e-06],\n",
      "       [ 6.9768621e-06,  7.0103742e-05, -1.2736261e-06, ...,\n",
      "         3.0021670e-06, -1.5956225e-06, -2.6852851e-07],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[10]], dtype=uint8), 'glove': array([[ 50.823647 ,  10.8672905,  25.345934 , ...,  28.676538 ,\n",
      "          8.405864 ,   2.470594 ],\n",
      "       [ 50.823647 ,  10.8672905,  25.345934 , ...,  28.676538 ,\n",
      "          8.405864 ,   2.470594 ],\n",
      "       [ 50.823647 ,  10.8672905,  25.345934 , ...,  28.676538 ,\n",
      "          8.405864 ,   2.470594 ],\n",
      "       ...,\n",
      "       [ 17.243738 , -11.703236 ,  31.06921  , ...,  49.01081  ,\n",
      "          4.944626 ,   2.919793 ],\n",
      "       [ 17.243738 , -11.703236 ,  31.06921  , ...,  49.01081  ,\n",
      "          4.944626 ,   2.919793 ],\n",
      "       [ 17.243738 , -11.703236 ,  31.06921  , ...,  49.01081  ,\n",
      "          4.944626 ,   2.919793 ]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S10_E1_A3.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:08 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-1.2213888e-05,  1.2848358e-05,  1.4171899e-06, ...,\n",
      "         2.4547974e-06, -3.5635583e-07,  3.9899796e-06],\n",
      "       [-1.1034591e-05,  1.1959419e-05, -8.0825924e-07, ...,\n",
      "         7.5772382e-06, -7.6994631e-08,  9.7154589e-06],\n",
      "       [-5.5595945e-07,  1.0261851e-05, -9.0351966e-07, ...,\n",
      "         9.7515685e-06, -2.5459797e-06,  6.3704433e-06],\n",
      "       ...,\n",
      "       [-3.5108628e-06, -1.2804191e-05,  1.3349400e-06, ...,\n",
      "        -3.4621539e-07, -2.2962845e-06,  1.2677652e-06],\n",
      "       [-9.1614737e-07, -1.4396191e-05,  3.9385824e-07, ...,\n",
      "        -1.8846814e-06, -2.8121669e-06,  1.2581410e-07],\n",
      "       [ 8.8349225e-08, -1.3151894e-05, -2.0248261e-07, ...,\n",
      "        -2.3238319e-06, -3.3372892e-06,  1.1472472e-07]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[1]], dtype=uint8), 'glove': array([[ 46.5872   , -14.4243555,  22.320053 , ...,  41.629326 ,\n",
      "          2.8205853,   5.1383142],\n",
      "       [ 46.5872   , -14.4243555,  22.320053 , ...,  41.629326 ,\n",
      "          2.8205853,   5.1383142],\n",
      "       [ 46.5872   , -14.4243555,  22.320053 , ...,  41.629326 ,\n",
      "          2.8205853,   5.1383142],\n",
      "       ...,\n",
      "       [ 50.314175 , -25.619379 ,  24.861235 , ...,  62.55128  ,\n",
      "          8.919148 ,   3.5572944],\n",
      "       [ 50.314175 , -25.619379 ,  24.861235 , ...,  62.55128  ,\n",
      "          8.919148 ,   3.5572944],\n",
      "       [ 50.314175 , -25.619379 ,  24.861235 , ...,  62.55128  ,\n",
      "          8.919148 ,   3.5572944]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S1_E1_A1.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:14 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-6.8929245e-07, -7.4303357e-06, -4.1601274e-06, ...,\n",
      "        -1.6810241e-06,  2.1331346e-07, -5.7909074e-07],\n",
      "       [-1.9112442e-06, -7.4422705e-06, -4.6720706e-06, ...,\n",
      "        -2.6220241e-06,  6.0667554e-07, -1.2720354e-06],\n",
      "       [-2.6900052e-06, -6.9293233e-06, -3.3303925e-06, ...,\n",
      "        -5.2097935e-06,  2.8132871e-07, -1.0347522e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[1]], dtype=uint8), 'glove': array([[ 40.06499  , -28.202845 ,  22.320053 , ...,  33.04596  ,\n",
      "         -1.2451233,   4.009014 ],\n",
      "       [ 40.06499  , -28.202845 ,  22.320053 , ...,  33.04596  ,\n",
      "         -1.2451233,   4.009014 ],\n",
      "       [ 40.06499  , -28.202845 ,  22.320053 , ...,  33.04596  ,\n",
      "         -1.2451233,   4.009014 ],\n",
      "       ...,\n",
      "       [ 58.69987  , -22.174755 ,  20.62593  , ...,  55.040836 ,\n",
      "          9.4273615,   3.1055746],\n",
      "       [ 58.69987  , -22.174755 ,  20.62593  , ...,  55.040836 ,\n",
      "          9.4273615,   3.1055746],\n",
      "       [ 58.69987  , -22.174755 ,  20.62593  , ...,  55.040836 ,\n",
      "          9.4273615,   3.1055746]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S1_E1_A2.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:16 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-3.7426202e-05, -8.1704056e-05, -3.9125562e-06, ...,\n",
      "         1.6393825e-06, -4.2118654e-06, -4.4509852e-07],\n",
      "       [-3.7150741e-05, -1.2128010e-04, -5.6217191e-06, ...,\n",
      "         1.6269227e-06, -4.0678669e-06, -9.6552731e-07],\n",
      "       [-3.2224529e-05, -1.4520844e-04, -7.3935453e-06, ...,\n",
      "         2.0837442e-06, -4.0432351e-06,  1.1049610e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[1]], dtype=uint8), 'glove': array([[ 53.109406 , -31.647467 ,  22.320053 , ...,  34.11888  ,\n",
      "          1.8041582,   4.912454 ],\n",
      "       [ 53.109406 , -31.647467 ,  22.320053 , ...,  34.11888  ,\n",
      "          1.8041582,   4.912454 ],\n",
      "       [ 53.109406 , -31.647467 ,  22.320053 , ...,  34.11888  ,\n",
      "          1.8041582,   4.912454 ],\n",
      "       ...,\n",
      "       [ 53.109406 , -18.730133 ,  22.320053 , ...,  51.822075 ,\n",
      "          5.869867 ,   4.4607344],\n",
      "       [ 53.109406 , -18.730133 ,  22.320053 , ...,  51.822075 ,\n",
      "          5.869867 ,   4.4607344],\n",
      "       [ 53.109406 , -18.730133 ,  22.320053 , ...,  51.822075 ,\n",
      "          5.869867 ,   4.4607344]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S1_E1_A3.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:22 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-5.2790665e-06, -2.6618711e-06,  2.2483448e-06, ...,\n",
      "         9.1936352e-07, -1.5476244e-06, -4.0255795e-06],\n",
      "       [-4.1749499e-06, -5.4797147e-07,  1.1923521e-06, ...,\n",
      "         8.5134167e-07, -5.7359324e-07, -1.7384225e-06],\n",
      "       [-2.7680394e-06, -2.8438313e-07,  1.2660001e-06, ...,\n",
      "         9.6260760e-07, -3.0480291e-07,  5.4310681e-07],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[2]], dtype=uint8), 'glove': array([[ 47.518944 , -23.035912 ,  23.167112 , ...,  18.025068 ,\n",
      "          6.886294 ,   2.4279945],\n",
      "       [ 47.518944 , -23.035912 ,  23.167112 , ...,  18.025068 ,\n",
      "          6.886294 ,   2.4279945],\n",
      "       [ 47.518944 , -23.035912 ,  23.167112 , ...,  18.025068 ,\n",
      "          6.886294 ,   2.4279945],\n",
      "       ...,\n",
      "       [ 53.109406 , -17.007822 ,  25.708296 , ...,  30.363657 ,\n",
      "          8.410934 ,   2.2021346],\n",
      "       [ 53.109406 , -17.007822 ,  25.708296 , ...,  30.363657 ,\n",
      "          8.410934 ,   2.2021346],\n",
      "       [ 53.109406 , -17.007822 ,  25.708296 , ...,  30.363657 ,\n",
      "          8.410934 ,   2.2021346]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S2_E1_A1.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:28 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-1.7215644e-06,  7.4224163e-06,  2.1113972e-06, ...,\n",
      "        -2.0936670e-06,  2.8152306e-06, -2.6731016e-06],\n",
      "       [-2.6945045e-06,  3.6975539e-06, -4.7361252e-07, ...,\n",
      "        -3.3947904e-06, -3.3526530e-07, -6.5262881e-08],\n",
      "       [-1.7835323e-06,  5.1065689e-07, -7.9479457e-07, ...,\n",
      "        -3.9399583e-06, -1.1717883e-06,  1.2111208e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[2]], dtype=uint8), 'glove': array([[ 53.109406 , -19.59129  ,  29.096539 , ...,  12.660465 ,\n",
      "          4.345226 ,   2.4279945],\n",
      "       [ 53.109406 , -19.59129  ,  29.096539 , ...,  12.660465 ,\n",
      "          4.345226 ,   2.4279945],\n",
      "       [ 53.109406 , -19.59129  ,  29.096539 , ...,  12.660465 ,\n",
      "          4.345226 ,   2.4279945],\n",
      "       ...,\n",
      "       [ 59.631615 , -16.146667 ,  25.708296 , ...,  10.514624 ,\n",
      "          6.886294 ,   1.5245547],\n",
      "       [ 59.631615 , -16.146667 ,  25.708296 , ...,  10.514624 ,\n",
      "          6.886294 ,   1.5245547],\n",
      "       [ 59.631615 , -16.146667 ,  25.708296 , ...,  10.514624 ,\n",
      "          6.886294 ,   1.5245547]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S2_E1_A2.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:29 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 4.0236328e-06, -9.8650321e-07,  6.4750379e-06, ...,\n",
      "        -3.9475658e-06,  9.3689300e-07,  3.2536714e-06],\n",
      "       [ 2.7352514e-06,  1.0389201e-06,  6.8631466e-06, ...,\n",
      "        -4.9504306e-06,  1.1427745e-06,  3.1545230e-06],\n",
      "       [ 6.8495405e-07,  8.5094558e-07,  6.3449293e-06, ...,\n",
      "        -4.1423568e-06,  1.4901044e-06,  1.2595063e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[2]], dtype=uint8), 'glove': array([[ 59.631615 , -24.758223 ,  23.167112 , ...,  14.269846 ,\n",
      "          4.345226 ,   1.9762747],\n",
      "       [ 59.631615 , -24.758223 ,  23.167112 , ...,  14.269846 ,\n",
      "          4.345226 ,   1.9762747],\n",
      "       [ 59.631615 , -24.758223 ,  23.167112 , ...,  14.269846 ,\n",
      "          4.345226 ,   1.9762747],\n",
      "       ...,\n",
      "       [ 55.904636 , -20.452444 ,  25.708296 , ...,  34.11888  ,\n",
      "          8.410934 ,   2.6538546],\n",
      "       [ 55.904636 , -20.452444 ,  25.708296 , ...,  34.11888  ,\n",
      "          8.410934 ,   2.6538546],\n",
      "       [ 55.904636 , -20.452444 ,  25.708296 , ...,  34.11888  ,\n",
      "          8.410934 ,   2.6538546]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S2_E1_A3.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:35 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-5.2611304e-06,  4.1910798e-06, -1.4432375e-06, ...,\n",
      "         3.0112722e-06, -1.5800929e-06, -6.4482638e-06],\n",
      "       [-4.3224013e-06,  4.0288660e-06,  3.1114766e-07, ...,\n",
      "         2.9445432e-06, -9.8128908e-07, -2.9638127e-06],\n",
      "       [-2.8258769e-06,  3.5218127e-06,  3.3499437e-06, ...,\n",
      "        -1.2107786e-07, -8.5207688e-07, -8.1424872e-07],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[3]], dtype=uint8), 'glove': array([[ 46.5872   , -27.34169  ,  35.873024 , ...,  16.952148 ,\n",
      "          2.3123717,  -3.4443645],\n",
      "       [ 46.5872   , -27.34169  ,  35.873024 , ...,  16.952148 ,\n",
      "          2.3123717,  -3.4443645],\n",
      "       [ 46.5872   , -27.34169  ,  35.873024 , ...,  16.952148 ,\n",
      "          2.3123717,  -3.4443645],\n",
      "       ...,\n",
      "       [ 32.61104  , -29.064001 ,  35.025963 , ...,  21.243832 ,\n",
      "          5.869867 ,  -1.1857648],\n",
      "       [ 32.61104  , -29.064001 ,  35.025963 , ...,  21.243832 ,\n",
      "          5.869867 ,  -1.1857648],\n",
      "       [ 32.61104  , -29.064001 ,  35.025963 , ...,  21.243832 ,\n",
      "          5.869867 ,  -1.1857648]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S3_E1_A1.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:41 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-1.95967641e-06, -2.17115871e-06, -1.00479965e-05, ...,\n",
      "         4.50514244e-06,  3.81928066e-06, -1.78105097e-06],\n",
      "       [-2.32450793e-06, -2.78755920e-07, -8.93026481e-06, ...,\n",
      "         8.14140151e-07,  4.14547003e-06, -4.38519152e-07],\n",
      "       [-7.15143074e-07,  1.87456135e-06, -9.95155915e-06, ...,\n",
      "        -5.47437025e-07,  3.76151979e-06,  2.85234819e-06],\n",
      "       ...,\n",
      "       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00, ...,\n",
      "         0.00000000e+00,  0.00000000e+00,  0.00000000e+00],\n",
      "       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00, ...,\n",
      "         0.00000000e+00,  0.00000000e+00,  0.00000000e+00],\n",
      "       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00, ...,\n",
      "         0.00000000e+00,  0.00000000e+00,  0.00000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[3]], dtype=uint8), 'glove': array([[ 63.35859  , -28.202845 ,  34.1789   , ...,  -3.969807 ,\n",
      "         -4.802618 ,  -2.0892045],\n",
      "       [ 63.35859  , -28.202845 ,  34.1789   , ...,  -3.969807 ,\n",
      "         -4.802618 ,  -2.0892045],\n",
      "       [ 63.35859  , -28.202845 ,  34.1789   , ...,  -3.969807 ,\n",
      "         -4.802618 ,  -2.0892045],\n",
      "       ...,\n",
      "       [ 42.86022  , -22.174755 ,  38.414207 , ...,  13.733386 ,\n",
      "         -3.786191 ,  -3.4443645],\n",
      "       [ 42.86022  , -22.174755 ,  38.414207 , ...,  13.733386 ,\n",
      "         -3.786191 ,  -3.4443645],\n",
      "       [ 42.86022  , -22.174755 ,  38.414207 , ...,  13.733386 ,\n",
      "         -3.786191 ,  -3.4443645]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S3_E1_A2.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:43 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 1.6570045e-06,  2.4475714e-06, -7.0654501e-06, ...,\n",
      "        -2.0429738e-06, -2.9839948e-06, -1.9001986e-06],\n",
      "       [ 2.7036783e-06,  3.0300573e-06, -4.7997892e-06, ...,\n",
      "        -3.4368250e-06, -1.4082323e-06, -2.2576467e-06],\n",
      "       [ 4.0601572e-06,  2.9566309e-06, -2.9722860e-06, ...,\n",
      "        -3.0758551e-06, -3.1865784e-07, -1.9049738e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[3]], dtype=uint8), 'glove': array([[ 38.201504  , -25.619379  ,  37.567146  , ...,  14.806307  ,\n",
      "         -7.343686  ,  -3.6702244 ],\n",
      "       [ 38.201504  , -25.619379  ,  37.567146  , ...,  14.806307  ,\n",
      "         -7.343686  ,  -3.6702244 ],\n",
      "       [ 38.201504  , -25.619379  ,  37.567146  , ...,  14.806307  ,\n",
      "         -7.343686  ,  -3.6702244 ],\n",
      "       ...,\n",
      "       [ 23.2936    , -29.925156  ,  42.649513  , ...,  22.316751  ,\n",
      "          0.78773105,  -3.6702244 ],\n",
      "       [ 23.2936    , -29.925156  ,  42.649513  , ...,  22.316751  ,\n",
      "          0.78773105,  -3.6702244 ],\n",
      "       [ 23.2936    , -29.925156  ,  42.649513  , ...,  22.316751  ,\n",
      "          0.78773105,  -3.6702244 ]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S3_E1_A3.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:48 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 5.1029883e-06,  2.0468797e-05,  9.4874667e-06, ...,\n",
      "        -6.7142910e-06, -2.3069565e-06,  9.3043845e-06],\n",
      "       [ 6.2586919e-06,  1.3247134e-05,  6.6312118e-06, ...,\n",
      "        -7.1948675e-06, -2.5637348e-06,  1.0162955e-05],\n",
      "       [ 5.4466818e-06,  1.4048170e-06,  2.4510275e-06, ...,\n",
      "        -6.1197729e-06, -2.4481283e-06,  9.3286926e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[4]], dtype=uint8), 'glove': array([[-9.31744  , -1.5070223, 18.931808 , ..., 37.874104 ,  5.3616533,\n",
      "         2.8797145],\n",
      "       [-9.31744  , -1.5070223, 18.931808 , ..., 37.874104 ,  5.3616533,\n",
      "         2.8797145],\n",
      "       [-9.31744  , -1.5070223, 18.931808 , ..., 37.874104 ,  5.3616533,\n",
      "         2.8797145],\n",
      "       ...,\n",
      "       [-3.726976 ,  2.7987556, 21.472992 , ..., 21.780293 ,  4.345226 ,\n",
      "         3.3314345],\n",
      "       [-3.726976 ,  2.7987556, 21.472992 , ..., 21.780293 ,  4.345226 ,\n",
      "         3.3314345],\n",
      "       [-3.726976 ,  2.7987556, 21.472992 , ..., 21.780293 ,  4.345226 ,\n",
      "         3.3314345]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S4_E1_A1.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:54 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 6.4342107e-06,  1.1949472e-05,  1.0179873e-05, ...,\n",
      "        -4.1642097e-06,  3.9688466e-06,  1.3649695e-05],\n",
      "       [ 7.9621077e-06,  1.8406367e-05,  1.2250337e-05, ...,\n",
      "        -4.0008831e-06,  3.1114805e-06,  1.2815891e-05],\n",
      "       [ 8.6484815e-06,  2.7669621e-05,  1.4553247e-05, ...,\n",
      "        -2.4043422e-06,  2.0933514e-06,  1.3227474e-05],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[4]], dtype=uint8), 'glove': array([[ -6.5222077 , -22.174755  ,   7.0729575 , ...,  15.879228  ,\n",
      "          5.869867  ,   3.3314345 ],\n",
      "       [ -6.5222077 , -22.174755  ,   7.0729575 , ...,  15.879228  ,\n",
      "          5.869867  ,   3.3314345 ],\n",
      "       [ -6.5222077 , -22.174755  ,   7.0729575 , ...,  15.879228  ,\n",
      "          5.869867  ,   3.3314345 ],\n",
      "       ...,\n",
      "       [  2.7952318 ,   0.21528889,  23.167112  , ...,  37.337643  ,\n",
      "          4.8534393 ,   3.3314345 ],\n",
      "       [  2.7952318 ,   0.21528889,  23.167112  , ...,  37.337643  ,\n",
      "          4.8534393 ,   3.3314345 ],\n",
      "       [  2.7952318 ,   0.21528889,  23.167112  , ...,  37.337643  ,\n",
      "          4.8534393 ,   3.3314345 ]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S4_E1_A2.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:42:56 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 6.1838109e-06,  2.8752187e-05,  3.7040998e-05, ...,\n",
      "         4.0540931e-06,  9.3545771e-07,  3.6373924e-06],\n",
      "       [ 1.4779207e-06,  4.5501878e-05,  5.0507548e-05, ...,\n",
      "        -6.4660458e-07,  1.5195351e-06,  1.8780154e-06],\n",
      "       [-2.6989774e-06,  5.6813638e-05,  6.6273999e-05, ...,\n",
      "        -5.0395201e-06,  1.2261588e-06,  1.7122221e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[4]], dtype=uint8), 'glove': array([[ -8.385695 , -22.174755 ,  18.931808 , ..., -13.626094 ,\n",
      "          5.3616533,   5.590034 ],\n",
      "       [ -8.385695 , -22.174755 ,  18.931808 , ..., -13.626094 ,\n",
      "          5.3616533,   5.590034 ],\n",
      "       [ -8.385695 , -22.174755 ,  18.931808 , ..., -13.626094 ,\n",
      "          5.3616533,   5.590034 ],\n",
      "       ...,\n",
      "       [ 13.044415 ,   5.382222 ,  22.320053 , ...,  44.848087 ,\n",
      "          2.8205853,   1.0728348],\n",
      "       [ 13.044415 ,   5.382222 ,  22.320053 , ...,  44.848087 ,\n",
      "          2.8205853,   1.0728348],\n",
      "       [ 13.044415 ,   5.382222 ,  22.320053 , ...,  44.848087 ,\n",
      "          2.8205853,   1.0728348]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S4_E1_A3.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:01 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-2.4396509e-06, -9.5297964e-06,  5.9377639e-06, ...,\n",
      "         3.2368453e-06, -5.5480044e-08,  3.9306592e-06],\n",
      "       [ 9.8530609e-06,  2.4879782e-05,  1.4341067e-05, ...,\n",
      "         9.2737228e-06, -6.6552627e-07,  4.1758094e-06],\n",
      "       [ 1.1247911e-05,  3.3692835e-05,  1.4948890e-05, ...,\n",
      "         1.0896513e-05, -1.5982290e-06,  6.3278782e-07],\n",
      "       ...,\n",
      "       [ 8.9451959e-08, -3.3354395e-06, -3.3821957e-06, ...,\n",
      "         2.0416919e-06,  9.9293977e-08,  2.2240602e-06],\n",
      "       [ 1.1603630e-06, -3.3874492e-06, -3.2021294e-06, ...,\n",
      "         1.2495573e-06, -6.1459610e-07,  1.5323441e-06],\n",
      "       [ 8.6593468e-07, -4.2690654e-06, -3.9994879e-06, ...,\n",
      "         9.7409395e-07, -1.4200306e-06,  1.5376085e-06]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[5]], dtype=uint8), 'glove': array([[ 49.38243  , -14.4243555,  26.555357 , ...,  40.556404 ,\n",
      "          5.869867 ,   2.6538546],\n",
      "       [ 49.38243  , -14.4243555,  26.555357 , ...,  40.556404 ,\n",
      "          5.869867 ,   2.6538546],\n",
      "       [ 49.38243  , -14.4243555,  26.555357 , ...,  40.556404 ,\n",
      "          5.869867 ,   2.6538546],\n",
      "       ...,\n",
      "       [ 63.35859  ,  -5.8128   ,  26.555357 , ...,  51.822075 ,\n",
      "          3.8370125,   2.8797145],\n",
      "       [ 63.35859  ,  -5.8128   ,  26.555357 , ...,  51.822075 ,\n",
      "          3.8370125,   2.8797145],\n",
      "       [        nan,         nan,         nan, ...,         nan,\n",
      "                nan,         nan]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S5_E1_A1.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:07 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-8.4064450e-06, -1.6788533e-06, -6.8219183e-06, ...,\n",
      "        -3.8415237e-06,  1.7676421e-06, -6.5062422e-06],\n",
      "       [-6.9233943e-06,  9.2927957e-07, -4.9525261e-06, ...,\n",
      "        -2.8894970e-06,  2.0088119e-06, -4.4348185e-06],\n",
      "       [-4.6883356e-06,  3.2650137e-06, -2.0424029e-06, ...,\n",
      "        -1.7450244e-06,  2.0846012e-06, -3.0583694e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[5]], dtype=uint8), 'glove': array([[64.29034   , -2.368178  , 32.484783  , ..., 51.822075  ,\n",
      "         4.8534393 ,  1.0728348 ],\n",
      "       [64.29034   , -2.368178  , 32.484783  , ..., 51.822075  ,\n",
      "         4.8534393 ,  1.0728348 ],\n",
      "       [64.29034   , -2.368178  , 32.484783  , ..., 51.822075  ,\n",
      "         4.8534393 ,  1.0728348 ],\n",
      "       ...,\n",
      "       [41.92848   , -4.9516444 , 25.708296  , ..., 70.06173   ,\n",
      "         6.886294  ,  0.16939497],\n",
      "       [41.92848   , -4.9516444 , 25.708296  , ..., 70.06173   ,\n",
      "         6.886294  ,  0.16939497],\n",
      "       [41.92848   , -4.9516444 , 25.708296  , ..., 70.06173   ,\n",
      "         6.886294  ,  0.16939497]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S5_E1_A2.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:09 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 6.1115957e-06,  8.2888264e-06,  2.4053256e-06, ...,\n",
      "         2.3638661e-06, -1.6507696e-06, -5.4512964e-07],\n",
      "       [ 2.5027423e-06,  2.2562876e-06,  5.0618537e-06, ...,\n",
      "         1.9514283e-07, -1.5068740e-06,  1.7406512e-06],\n",
      "       [-1.1967552e-06, -3.0721860e-06,  5.4010452e-06, ...,\n",
      "        -1.4606412e-06, -1.7235066e-06,  1.1411493e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[5]], dtype=uint8), 'glove': array([[63.35859  , -6.6739554, 27.402416 , ..., 43.775166 ,  5.869867 ,\n",
      "         2.8797145],\n",
      "       [63.35859  , -6.6739554, 27.402416 , ..., 43.775166 ,  5.869867 ,\n",
      "         2.8797145],\n",
      "       [63.35859  , -6.6739554, 27.402416 , ..., 43.775166 ,  5.869867 ,\n",
      "         2.8797145],\n",
      "       ...,\n",
      "       [40.06499  , -6.6739554, 24.861235 , ..., 64.69712  ,  6.886294 ,\n",
      "         1.2986947],\n",
      "       [40.06499  , -6.6739554, 24.861235 , ..., 64.69712  ,  6.886294 ,\n",
      "         1.2986947],\n",
      "       [40.06499  , -6.6739554, 24.861235 , ..., 64.69712  ,  6.886294 ,\n",
      "         1.2986947]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S5_E1_A3.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:15 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 1.5930852e-06, -2.5627716e-09,  1.4088278e-06, ...,\n",
      "        -1.4582860e-06, -3.1635550e-06, -1.4960226e-05],\n",
      "       [ 3.0699132e-06,  1.1183843e-06,  1.2840109e-06, ...,\n",
      "        -2.8615527e-06, -1.2829680e-06, -1.2790975e-05],\n",
      "       [ 1.9938147e-06, -3.1151112e-07,  1.0536307e-06, ...,\n",
      "        -1.6867072e-06, -3.7597076e-07, -1.0034731e-05],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[6]], dtype=uint8), 'glove': array([[ 42.86022  , -17.868979 ,  29.096539 , ...,  37.874104 ,\n",
      "          2.3123717,  -0.5081849],\n",
      "       [ 42.86022  , -17.868979 ,  29.096539 , ...,  37.874104 ,\n",
      "          2.3123717,  -0.5081849],\n",
      "       [ 42.86022  , -17.868979 ,  29.096539 , ...,  37.874104 ,\n",
      "          2.3123717,  -0.5081849],\n",
      "       ...,\n",
      "       [ 30.747551 , -19.59129  ,  29.9436   , ...,  36.80118  ,\n",
      "          4.8534393,   2.4279945],\n",
      "       [ 30.747551 , -19.59129  ,  29.9436   , ...,  36.80118  ,\n",
      "          4.8534393,   2.4279945],\n",
      "       [ 30.747551 , -19.59129  ,  29.9436   , ...,  36.80118  ,\n",
      "          4.8534393,   2.4279945]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S6_E1_A1.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:21 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 1.4164923e-05,  3.9124970e-06,  3.1006408e-08, ...,\n",
      "         3.8725652e-06,  2.1871435e-06, -1.0496906e-06],\n",
      "       [ 9.6004323e-06,  1.2955683e-06, -3.2704227e-06, ...,\n",
      "         1.4026158e-06, -1.4882863e-07, -1.7818795e-06],\n",
      "       [ 5.7658381e-06,  6.7235464e-07, -5.0220056e-06, ...,\n",
      "         1.7457779e-07, -1.3356912e-06, -1.4784399e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[6]], dtype=uint8), 'glove': array([[ 51.24592   ,  -4.9516444 ,  31.63772   , ...,  10.514624  ,\n",
      "         -0.22869611,   2.4279945 ],\n",
      "       [ 51.24592   ,  -4.9516444 ,  31.63772   , ...,  10.514624  ,\n",
      "         -0.22869611,   2.4279945 ],\n",
      "       [ 51.24592   ,  -4.9516444 ,  31.63772   , ...,  10.514624  ,\n",
      "         -0.22869611,   2.4279945 ],\n",
      "       ...,\n",
      "       [ 24.225344  , -14.4243555 ,  30.79066   , ...,  30.363657  ,\n",
      "          3.3287988 ,   2.6538546 ],\n",
      "       [ 24.225344  , -14.4243555 ,  30.79066   , ...,  30.363657  ,\n",
      "          3.3287988 ,   2.6538546 ],\n",
      "       [ 24.225344  , -14.4243555 ,  30.79066   , ...,  30.363657  ,\n",
      "          3.3287988 ,   2.6538546 ]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S6_E1_A2.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:23 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 1.2018941e-05,  1.5733844e-05,  7.1664173e-05, ...,\n",
      "         4.6244898e-07,  7.2988377e-07,  9.6556951e-06],\n",
      "       [ 1.1410433e-05,  5.9574750e-06,  1.2288071e-04, ...,\n",
      "         1.0167557e-06,  1.3373210e-06,  8.0307118e-06],\n",
      "       [ 1.2985345e-05, -5.5431092e-06,  4.2183729e-05, ...,\n",
      "         2.2629272e-06,  3.2736884e-06,  8.6724531e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[6]], dtype=uint8), 'glove': array([[ 37.26976  ,  -6.6739554,  31.63772  , ...,  12.124004 ,\n",
      "         -2.769764 ,   2.6538546],\n",
      "       [ 37.26976  ,  -6.6739554,  31.63772  , ...,  12.124004 ,\n",
      "         -2.769764 ,   2.6538546],\n",
      "       [ 37.26976  ,  -6.6739554,  31.63772  , ...,  12.124004 ,\n",
      "         -2.769764 ,   2.6538546],\n",
      "       ...,\n",
      "       [ 29.815807 , -16.146667 ,  30.79066  , ...,  21.243832 ,\n",
      "          1.8041582,   2.8797145],\n",
      "       [ 29.815807 , -16.146667 ,  30.79066  , ...,  21.243832 ,\n",
      "          1.8041582,   2.8797145],\n",
      "       [ 29.815807 , -16.146667 ,  30.79066  , ...,  21.243832 ,\n",
      "          1.8041582,   2.8797145]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S6_E1_A3.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:28 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-4.0316463e-06,  2.1945618e-05,  7.8958174e-06, ...,\n",
      "        -8.2131264e-06,  1.7158344e-06, -5.0312983e-06],\n",
      "       [-5.4933430e-06,  2.2117325e-05,  6.7122719e-06, ...,\n",
      "        -7.2562621e-06,  3.3436738e-08, -2.5351635e-06],\n",
      "       [-5.4474394e-06,  1.9156623e-05,  4.1978369e-06, ...,\n",
      "        -5.7186589e-06, -1.9028960e-06, -1.5063567e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[7]], dtype=uint8), 'glove': array([[45.378258, 17.554853, 26.163546, ...,  6.778091, 11.867102,\n",
      "         2.919793],\n",
      "       [45.378258, 17.554853, 26.163546, ...,  6.778091, 11.867102,\n",
      "         2.919793],\n",
      "       [45.378258, 17.554853, 26.163546, ...,  6.778091, 11.867102,\n",
      "         2.919793],\n",
      "       ...,\n",
      "       [30.857216, 26.750254, 28.616377, ..., 15.641747, 12.361565,\n",
      "         5.390387],\n",
      "       [30.857216, 26.750254, 28.616377, ..., 15.641747, 12.361565,\n",
      "         5.390387],\n",
      "       [30.857216, 26.750254, 28.616377, ..., 15.641747, 12.361565,\n",
      "         5.390387]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S7_E1_A1.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:34 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-4.93697517e-05, -5.52286292e-06, -4.13759335e-06, ...,\n",
      "        -3.29157274e-06,  1.35262098e-06, -1.01231763e-06],\n",
      "       [-3.48142385e-05,  1.62633398e-06, -6.25690427e-06, ...,\n",
      "        -6.66486358e-06, -2.08663732e-06,  1.42483557e-07],\n",
      "       [-1.32329305e-05,  7.34350806e-06, -7.93671825e-06, ...,\n",
      "        -8.75139085e-06, -5.71609371e-06, -1.80222730e-06],\n",
      "       ...,\n",
      "       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00, ...,\n",
      "         0.00000000e+00,  0.00000000e+00,  0.00000000e+00],\n",
      "       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00, ...,\n",
      "         0.00000000e+00,  0.00000000e+00,  0.00000000e+00],\n",
      "       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00, ...,\n",
      "         0.00000000e+00,  0.00000000e+00,  0.00000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[7]], dtype=uint8), 'glove': array([[34.487476 ,  2.5078363, 27.798767 , ..., 25.026796 ,  9.394789 ,\n",
      "         4.7165885],\n",
      "       [34.487476 ,  2.5078363, 27.798767 , ..., 25.026796 ,  9.394789 ,\n",
      "         4.7165885],\n",
      "       [34.487476 ,  2.5078363, 27.798767 , ..., 25.026796 ,  9.394789 ,\n",
      "         4.7165885],\n",
      "       ...,\n",
      "       [23.596693 , 12.539182 , 26.163546 , ...,  9.385049 , 13.35049  ,\n",
      "         4.0427904],\n",
      "       [23.596693 , 12.539182 , 26.163546 , ...,  9.385049 , 13.35049  ,\n",
      "         4.0427904],\n",
      "       [23.596693 , 12.539182 , 26.163546 , ...,  9.385049 , 13.35049  ,\n",
      "         4.0427904]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S7_E1_A2.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:36 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 5.4202965e-06,  1.5883821e-05,  6.1026544e-06, ...,\n",
      "         3.8683447e-06, -1.0522093e-06, -3.5623154e-06],\n",
      "       [ 1.0865371e-06,  1.2519578e-05,  3.7319314e-06, ...,\n",
      "         4.0312430e-06, -8.2375260e-07, -7.9899525e-07],\n",
      "       [-1.7761679e-06,  1.1126058e-05,  2.1905373e-06, ...,\n",
      "         3.7947007e-06, -5.4479483e-07,  6.4544668e-07],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[7]], dtype=uint8), 'glove': array([[36.302605 ,  7.523509 , 29.433989 , ..., 16.68453  ,  5.933551 ,\n",
      "         4.26739  ],\n",
      "       [36.302605 ,  7.523509 , 29.433989 , ..., 16.68453  ,  5.933551 ,\n",
      "         4.26739  ],\n",
      "       [36.302605 ,  7.523509 , 29.433989 , ..., 16.68453  ,  5.933551 ,\n",
      "         4.26739  ],\n",
      "       ...,\n",
      "       [41.747997 , 15.047018 , 28.616377 , ...,  7.2994823,  7.416939 ,\n",
      "         2.2459946],\n",
      "       [41.747997 , 15.047018 , 28.616377 , ...,  7.2994823,  7.416939 ,\n",
      "         2.2459946],\n",
      "       [41.747997 , 15.047018 , 28.616377 , ...,  7.2994823,  7.416939 ,\n",
      "         2.2459946]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S7_E1_A3.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:41 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 3.1433651e-06, -5.7496345e-06, -8.9173072e-06, ...,\n",
      "         3.7617358e-06,  9.3499142e-07,  3.4466264e-06],\n",
      "       [ 6.5248323e-06, -3.2974226e-06, -8.4567537e-06, ...,\n",
      "         2.5927852e-06,  2.7493052e-06,  6.1432667e-07],\n",
      "       [ 5.8267060e-06, -1.5942665e-06, -7.2042440e-06, ...,\n",
      "         1.5269076e-06,  3.7569671e-06,  3.1620407e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[8]], dtype=uint8), 'glove': array([[ 54.453907 , -17.554853 ,  17.987436 , ...,  40.147152 ,\n",
      "          4.4501634,   2.6951935],\n",
      "       [ 54.453907 , -17.554853 ,  17.987436 , ...,  40.147152 ,\n",
      "          4.4501634,   2.6951935],\n",
      "       [ 54.453907 , -17.554853 ,  17.987436 , ...,  40.147152 ,\n",
      "          4.4501634,   2.6951935],\n",
      "       ...,\n",
      "       [ 45.378258 ,   5.851618 ,  17.987436 , ...,  29.19793  ,\n",
      "          2.9667754,   1.7967956],\n",
      "       [ 45.378258 ,   5.851618 ,  17.987436 , ...,  29.19793  ,\n",
      "          2.9667754,   1.7967956],\n",
      "       [ 45.378258 ,   5.851618 ,  17.987436 , ...,  29.19793  ,\n",
      "          2.9667754,   1.7967956]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S8_E1_A1.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:47 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-3.1382267e-06, -3.5290032e-05,  4.0037662e-06, ...,\n",
      "        -3.1472698e-07, -1.3173687e-06,  2.5415395e-06],\n",
      "       [-4.2139877e-06, -2.5928508e-05,  8.1441049e-06, ...,\n",
      "         3.9727215e-06, -9.8386602e-07,  5.8305554e-06],\n",
      "       [-1.9891477e-06, -2.1344584e-05,  8.3733112e-06, ...,\n",
      "         2.4464543e-06, -1.8738409e-06,  3.9065330e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[8]], dtype=uint8), 'glove': array([[49.00852  ,  0.8359454, 21.25788  , ..., 11.470615 ,  4.944626 ,\n",
      "         4.0427904],\n",
      "       [49.00852  ,  0.8359454, 21.25788  , ..., 11.470615 ,  4.944626 ,\n",
      "         4.0427904],\n",
      "       [49.00852  ,  0.8359454, 21.25788  , ..., 11.470615 ,  4.944626 ,\n",
      "         4.0427904],\n",
      "       ...,\n",
      "       [41.747997 , 10.8672905, 19.622658 , ..., 18.248705 ,  4.4501634,\n",
      "         3.1443925],\n",
      "       [41.747997 , 10.8672905, 19.622658 , ..., 18.248705 ,  4.4501634,\n",
      "         3.1443925],\n",
      "       [41.747997 , 10.8672905, 19.622658 , ..., 18.248705 ,  4.4501634,\n",
      "         3.1443925]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S8_E1_A2.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:49 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 2.0459020e-06,  1.0044400e-05,  1.3260653e-06, ...,\n",
      "         2.7203057e-06,  1.8374874e-06, -1.4240477e-06],\n",
      "       [ 3.9337242e-06,  1.1140939e-05,  3.5081323e-06, ...,\n",
      "         3.1940706e-06,  7.3492805e-07, -1.3775308e-06],\n",
      "       [ 6.0117341e-06,  6.9418538e-06,  5.7619800e-06, ...,\n",
      "         2.3863447e-06, -1.1105658e-06, -2.3811331e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[8]], dtype=uint8), 'glove': array([[ 89.84895  ,  24.242416 ,  28.616377 , ...,  18.248705 ,\n",
      "          5.4390883,   3.5935912],\n",
      "       [ 89.84895  ,  24.242416 ,  28.616377 , ...,  18.248705 ,\n",
      "          5.4390883,   3.5935912],\n",
      "       [ 89.84895  ,  24.242416 ,  28.616377 , ...,  18.248705 ,\n",
      "          5.4390883,   3.5935912],\n",
      "       ...,\n",
      "       [ 42.655563 , -30.929981 ,  16.352215 , ...,  16.68453  ,\n",
      "          6.9224763,   3.8181908],\n",
      "       [ 42.655563 , -30.929981 ,  16.352215 , ...,  16.68453  ,\n",
      "          6.9224763,   3.8181908],\n",
      "       [ 42.655563 , -30.929981 ,  16.352215 , ...,  16.68453  ,\n",
      "          6.9224763,   3.8181908]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S8_E1_A3.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:43:54 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[-1.0045737e-05,  1.4252690e-05,  2.4180267e-06, ...,\n",
      "        -5.6936155e-06, -1.2471085e-07,  5.8652627e-06],\n",
      "       [-2.4218729e-05,  1.1452933e-05,  1.4922055e-06, ...,\n",
      "        -3.9236998e-06, -5.0465849e-07,  5.8278811e-06],\n",
      "       [-3.8525861e-05,  5.1946454e-06,  3.7898022e-08, ...,\n",
      "        -2.6220089e-06, -6.8373345e-07,  5.9420418e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[9]], dtype=uint8), 'glove': array([[ 18.151302  , -13.375127  ,  22.07549   , ...,  21.898447  ,\n",
      "          0.98892516,  -0.22459945],\n",
      "       [ 18.151302  , -13.375127  ,  22.07549   , ...,  21.898447  ,\n",
      "          0.98892516,  -0.22459945],\n",
      "       [ 18.151302  , -13.375127  ,  22.07549   , ...,  21.898447  ,\n",
      "          0.98892516,  -0.22459945],\n",
      "       ...,\n",
      "       [  0.9075652 ,   1.6718909 ,  24.528324  , ...,  12.513398  ,\n",
      "         -1.4833877 ,   2.2459946 ],\n",
      "       [  0.9075652 ,   1.6718909 ,  24.528324  , ...,  12.513398  ,\n",
      "         -1.4833877 ,   2.2459946 ],\n",
      "       [  0.9075652 ,   1.6718909 ,  24.528324  , ...,  12.513398  ,\n",
      "         -1.4833877 ,   2.2459946 ]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S9_E1_A1.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:44:00 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 1.6499336e-06, -6.5943459e-05,  2.1271865e-06, ...,\n",
      "         3.1298525e-06, -2.9725281e-06, -1.3809706e-06],\n",
      "       [ 7.2215028e-07, -6.7644090e-05,  1.3873753e-06, ...,\n",
      "         2.9664195e-06, -2.2105569e-06,  1.9786353e-06],\n",
      "       [ 1.5957215e-06, -3.8445669e-05, -4.7463183e-07, ...,\n",
      "         2.5415113e-06, -8.8490788e-07,  3.1193026e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[9]], dtype=uint8), 'glove': array([[ 8.168086 , -9.195399 , 25.345934 , ..., 20.855663 , -5.933551 ,\n",
      "         0.8983978],\n",
      "       [ 8.168086 , -9.195399 , 25.345934 , ..., 20.855663 , -5.933551 ,\n",
      "         0.8983978],\n",
      "       [ 8.168086 , -9.195399 , 25.345934 , ..., 20.855663 , -5.933551 ,\n",
      "         0.8983978],\n",
      "       ...,\n",
      "       [-5.4453907, -1.6718909, 27.798767 , ...,  0.5213916,  2.9667754,\n",
      "         0.       ],\n",
      "       [-5.4453907, -1.6718909, 27.798767 , ...,  0.5213916,  2.9667754,\n",
      "         0.       ],\n",
      "       [-5.4453907, -1.6718909, 27.798767 , ...,  0.5213916,  2.9667754,\n",
      "         0.       ]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S9_E1_A2.mat'], [{'__header__': b'MATLAB 5.0 MAT-file Platform: nt, Created on: Fri May  6 17:44:02 2022', '__version__': '1.0', '__globals__': [], 'emg': array([[ 2.1702675e-05, -1.5097869e-06, -4.0040291e-06, ...,\n",
      "         9.4084834e-07,  4.1584640e-06,  2.8680906e-06],\n",
      "       [ 3.4886758e-05,  1.4641789e-06, -1.5587455e-06, ...,\n",
      "         1.5325328e-06,  2.4571284e-06, -3.2690215e-07],\n",
      "       [ 5.7316327e-05,  6.8692993e-06,  2.3938678e-06, ...,\n",
      "         1.4365672e-06, -7.0904736e-07, -7.7151244e-06],\n",
      "       ...,\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00],\n",
      "       [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00, ...,\n",
      "         0.0000000e+00,  0.0000000e+00,  0.0000000e+00]], dtype=float32), 'exercise': array([[1]], dtype=uint8), 'subject': array([[9]], dtype=uint8), 'glove': array([[32.672344 , -2.5078363, 24.528324 , ..., 15.641747 ,  4.4501634,\n",
      "         1.5721962],\n",
      "       [32.672344 , -2.5078363, 24.528324 , ..., 15.641747 ,  4.4501634,\n",
      "         1.5721962],\n",
      "       [32.672344 , -2.5078363, 24.528324 , ..., 15.641747 ,  4.4501634,\n",
      "         1.5721962],\n",
      "       ...,\n",
      "       [23.596693 , -1.6718909, 27.798767 , ...,  3.1283495,  2.9667754,\n",
      "         0.6737984],\n",
      "       [23.596693 , -1.6718909, 27.798767 , ...,  3.1283495,  2.9667754,\n",
      "         0.6737984],\n",
      "       [23.596693 , -1.6718909, 27.798767 , ...,  3.1283495,  2.9667754,\n",
      "         0.6737984]], dtype=float32), 'restimulus': array([[0],\n",
      "       [0],\n",
      "       [0],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8), 'rerepetition': array([[1],\n",
      "       [1],\n",
      "       [1],\n",
      "       ...,\n",
      "       [0],\n",
      "       [0],\n",
      "       [0]], dtype=int8)}, 'S9_E1_A3.mat']]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "import matplotlib.pyplot as plt\n",
    "import os\n",
    "from scipy import interpolate\n",
    "\n",
    "dataDir = './EMG_data/splitDB8/'\n",
    "saveDir = './EMG_data/linear/'\n",
    "\n",
    "def findAllMat():\n",
    "    \"\"\"\n",
    "    @description  :找到dataDir下所有的mat文件\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    for root,dirs,files in os.walk(dataDir):\n",
    "        for f in files:\n",
    "            if(f.split('.')[-1]==\"mat\"):\n",
    "                yield f\n",
    "def linear_mat(input_list):\n",
    "    \"\"\"\n",
    "    @description  :\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    matData=input_list[0]\n",
    "    matFile=input_list[1]\n",
    "    x=[0]\n",
    "    y=[]\n",
    "    linear_data={}\n",
    "    linear_data['glove'] = []\n",
    "    for sensor in range(len(matData['glove'][0])):\n",
    "        sensor_data=matData['glove'][:,sensor]\n",
    "        data_pre=sensor_data[0]\n",
    "        x.clear()\n",
    "        y.clear()\n",
    "        x.append(0)\n",
    "        y.append(data_pre)\n",
    "        for index in range(len(sensor_data)):\n",
    "            if(sensor_data[index]!=data_pre):\n",
    "                data_pre=sensor_data[index]\n",
    "                x.append(index)\n",
    "                y.append(data_pre)\n",
    "            if(x[-1]<len(sensor_data)):\n",
    "                x.append(len(sensor_data)-1)\n",
    "                y.append(sensor_data[len(sensor_data)-1])\n",
    "        f = interpolate.interp1d(x, y)\n",
    "        ynew=f(np.arange(len(sensor_data)))\n",
    "        ynew=np.around(ynew, 4)\n",
    "        linear_data['glove'].append(ynew)\n",
    "    matData['glove']=np.array(linear_data['glove']).T\n",
    "    sio.savemat(saveDir+matFile, matData)\n",
    "\n",
    "from multiprocessing.dummy import Pool as ThreadPool\n",
    "pool = ThreadPool(processes=10)\n",
    "mat_list=[]\n",
    "for matFile in findAllMat(): \n",
    "    matData=sio.loadmat(dataDir+matFile)\n",
    "    mat_list.append([matData,matFile])\n",
    "results = pool.map(linear_mat, mat_list)\n",
    "pool.close()\n",
    "pool.join()\n",
    "\n",
    "\"\"\" for matFile in findAllMat(): \n",
    "    matData=sio.loadmat(dataDir+matFile)\n",
    "    linear_mat(matData,matFile)\n",
    "    break \"\"\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "发现训练时的loss很有规律  \n",
    "大概23680条数据为一个周期，一个文件大概有2292000条  \n",
    "有0-9个动作，其中0为复位  \n",
    "每个动作会重复10次  \n",
    "data_total=2292000  \n",
    "data_total/9(个动作)/10(10次重复)=25472 非常接近23680的数量级，也就是说动作改变的时候loss会突增突减\n",
    "\n",
    "## 归一化\n",
    "经过大佬提醒 LSTM应该需要输入数据归一化，因为它的传递函数式tanh，原始数据都是 e-7级别的虽然能用，但是也一定要归一化。  \n",
    "下面是归一化脚本。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "import os\n",
    "from scipy import interpolate\n",
    "from multiprocessing.dummy import Pool as ThreadPool\n",
    "\n",
    "dataDir = './EMG_data/thumb_scaled/'\n",
    "saveDir = './EMG_data/thumb_scaled/normalization/'\n",
    "\n",
    "def findAllMat():\n",
    "    \"\"\"\n",
    "    @description  :找到dataDir下所有的mat文件\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    for root,dirs,files in os.walk(dataDir):\n",
    "        for f in files:\n",
    "            if(f.split('.')[-1]==\"mat\"):\n",
    "                yield f\n",
    "def data_scaler(input_list):\n",
    "    \"\"\"\n",
    "    @description  :\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    scaler = MinMaxScaler(copy=False)\n",
    "    matData=input_list[0]\n",
    "    matFile=input_list[1]\n",
    "    norm_data={}\n",
    "    norm_data['emg'] = []\n",
    "\n",
    "    scaler.fit(matData['emg'])\n",
    "    norm_data['emg']=scaler.transform(matData['emg'])\n",
    "    matData['emg']=norm_data['emg']\n",
    "    sio.savemat(saveDir+matFile, matData)\n",
    "\n",
    "pool = ThreadPool()\n",
    "mat_list=[]\n",
    "for matFile in findAllMat(): \n",
    "    matData=sio.loadmat(dataDir+matFile)\n",
    "    mat_list.append([matData,matFile])\n",
    "results = pool.map(data_scaler, mat_list)\n",
    "pool.close()\n",
    "pool.join()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据丢失\n",
    "我这么相信他们的数据集果然是个错误，数据集里居然有丢失的数据。\n",
    "下面的脚本用来探测和裁剪数据集。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "import matplotlib.pyplot as plt\n",
    "import os\n",
    "from torch.utils.data import Dataset\n",
    "import torch\n",
    "from math import isnan\n",
    "dataDir = './EMG_data/linear/'\n",
    "saveDir = './EMG_data/nan_deled/'\n",
    "def findAllMat():\n",
    "    \"\"\"\n",
    "    @description  :找到dataDir下所有的mat文件\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    for root,dirs,files in os.walk(dataDir):\n",
    "        for f in files:\n",
    "            if(f.split('.')[-1]==\"mat\"):\n",
    "                yield f\n",
    "def readMat(mData, name, del_nan):\n",
    "    \"\"\"\n",
    "    @description  :读取并处理mat文件，找到nan的数据\n",
    "    ---------\n",
    "    @param  :mData 数据 name文件名 del_nan是否处理\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    h=-1\n",
    "    l=-1\n",
    "    mlist=['emg','glove','rerepetition','restimulus']\n",
    "    for i in range(0,4):\n",
    "        foo=mData[mlist[i]]\n",
    "        if(len(np.where(np.isnan(foo))[0])):\n",
    "            h=np.where(np.isnan(foo))[0][0] #行数-1(索引)\n",
    "            l=np.where(np.isnan(foo))[1][0] #列数-1\n",
    "            #print(name)\n",
    "            break\n",
    "    if(h!=-1 and del_nan):\n",
    "        for i in range(0,4):\n",
    "            mData[mlist[i]]=mData[mlist[i]][:h,]\n",
    "        sio.savemat(saveDir+name, mData)    \n",
    "\n",
    "\n",
    "for matFile in findAllMat():\n",
    "    matData = sio.loadmat(dataDir + matFile)\n",
    "    readMat(matData, matFile, True)\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Loss波动问题2\n",
    "这个波动问题还是没有解决  \n",
    "![图片](./pic/周期性.png)  \n",
    "可以看到Loss数据按5k为周期波动，另外这个数据的Batchsize为512，也就是说每512*5k条数据为一个周期，2 560 000这个数字很接近每份文件的2 292 000\n",
    "再次验证了数据问题\n",
    "经过一段时间的测试，batchsize=512时效果并没有batchsize=256和128时好，总体上来看128时Loss波动更小。  \n",
    "![图片](./pic/batchsize_Loss.png)  \n",
    "### 我认为的原因：\n",
    "batch与batch间不是 homogeneous 的（即内容差别太大）时，过大的batch才会导致向不同的方向更新参数，产生Loss波动的情况。我们的肌电数据采样频率非常的高，batch之间除了动作切换的瞬间往往不会有巨大的区别，较为连续。\n",
    "而batch_size变大时梯度更新相对较晚，导致其收敛变慢，相对的Loss也就更高。(我使用的损失函数经过平均，batch大小并不会造成Loss累加)  \n",
    "这解释了为什么128比512更好，但没能解释如何减小Loss的峰波动。\n",
    "首先我打印了train过程中的Output和作为Label的glove数据。\n",
    "![图片](./pic/train_accurate_and_Loss.png) \n",
    "可以清晰地看到在动作切换的一瞬间Loss变得非常大，将动作标号为0-9\n",
    "数据集中的动作顺序为01010101010101010101 02020202020·····09090909\n",
    "我们可以看到1.9k的数据为一个类似01010101010101010101的一个周期  \n",
    "1900/10次=190的数据为一个类似01的周期。\n",
    "根据loss的变化我们可以得知，我的神经网络很快的掌握了010101这样的周期，在glove数据稳定的动作停止时间内，更是能维持Loss低于0.01。  \n",
    "却没能掌握动作切换的隐函数，为什么学动作切换学的这么慢呢？原因我认为是数据量不够。  \n",
    "看似有很多数据，但是大部分都是重复的动作静止数据，一个数据集，动作变化的部分只有180次切换动作更是只有8+1(数据集衔接)次\n",
    "当然我也其实并不希望模型可以得去学习动作转变时的emg变化规律。\n",
    "## 突然想到的 数据映射有错\n",
    "现在我用sequence len个emg数据(t-len,t)去映射glove(t)实际上是错误的。  \n",
    "\n",
    "emg(t-len,t) 对应的应该是glove(t+肌肉响应延迟)-glove(t+肌肉响应延迟-len)  \n",
    "但是又不对，RNN本身就是为了映射趋势，从过去推导将来，借由记忆过去glove的隐变量再利用emg(t-len,t)推断next glove。那么我错在那里？  \n",
    "错在记忆的glove不是真的glove，而是利用emg(t-len,t)推断出的glove(t-len,t-1)看上去似乎没错，但是这样的积分是有极限的，受限于len的长度，并不能完整的得到积分出的值，而是一部分，如果glove发生大幅变动，那么就会超出积分的极限。  \n",
    "又看了眼LSTM，认为LSTM节点的记忆功能能从每次数据输入中截留信息，相当于做了积分操作。  \n",
    "但是根据这句注释  \n",
    "#reset the LSTM hidden state. Must be done before you run a new batch. Otherwise the LSTM will treat a new batch as a continuation of a sequence  \n",
    "我其实做错了，不该在forward里连续重置hidden state 的，这样会每个batch重置保留下来的信息。  \n",
    "如果我没理解错的话 重不重置都意味着每个batch实际是共用一个初始的hidden state的，如果初始化了hiddenstate倒是无所谓，但是现在想要继承的话就会导致时间序列被并行处理。不过考虑到训练速度，我只能说尽量减小batchsize  \n",
    "我觉得可以保留cn和hn输入到下一个序列的c0和h0。然而我失败了，实测无法继承cn hn  \n",
    "\n",
    "但是数据映射确实有错根据这个  emg(t-len,t) 对应的应该是glove(t+肌肉响应延迟)-glove(t+肌肉响应延迟-len)  \n",
    "glove(t)-glove(t-len)对应的应该是 emg(t-len-肌肉响应延迟,t-肌肉响应延迟) 又由于glove(t-len)实际以隐变量形势保存在LSTM里，所以glove(t)映射到emg(t-len-肌肉响应延迟,t-肌肉响应延迟)+LSTM_hidden  \n",
    "<font color=\"#dd0000\">表面肌电信号一般比肢体运动超前 30~150ms</font><br />  \n",
    "而对应glove(t+t*)数据的emg信号 即emg(t-肌肉响应延迟,t+t*)实际可以被LSTM网络忽略，也就是sequencelength只需大于30ms小于150ms,并在t时刻前设置一个30ms的死区就行。考虑到运算压力，且肌肉响应时间和肢体动量有关，我认为并不需要太长的sequencelength。  \n",
    "采样频率为2kHz 死区为60个数据，sequencelength最大为60->300 240，我选择100."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## TODO\n",
    "#由于没有超过sequence_length的长期记忆，所以解决方案有\n",
    "+ 1加大sequence_length     \n",
    "+ 2手动在输入参数中加上glove(t-len)\n",
    "+ 3按分类重新打乱数据集\n",
    "+ 4时间截断的反向传播TBPTT\n",
    "\n",
    "## 1加大sequence_length\n",
    "效果并不好，Loss减小变缓，训练时间大大延长，这种获取glove积分的方式不靠谱。  \n",
    "## 传递hidden state\n",
    "相当于把glove当做训练对象，输出也是glove而emg数据只作为辅助 但这里又有一个问题，这样就是闭环估计了，实际上我是取不到glove数据的，也就是我应该利用emg数据输出的glove而不是label里的glove  \n",
    "本来这部分工作应该是LSTM的hidden层负责保存的 然而我好像不能保存hidden层并输入下一个batch 反向传播的时候 hidden层已经被clear了\n",
    "又想了想，还是有可行性的，相当于我自己放了个长期记忆的cell保存我认为重要的数据。但是这样其实复杂化了问题，实际只需要保留hidden就行  \n",
    "研究了下，这步之所以做不了是因为没有tensor.detach(),这个实际和TBPTT为同一种操作，截断反向传播防止反向传播时追溯到很久以前的hidden。\n",
    "h_state = (h_state[0].detach(), h_state[1].detach()) 这样就行了  \n",
    "然而这只是问题解决的第一步，即便我们获取到了hidden_state,由于batch的存在，t-1的hidden_state并不能传入t时刻，而是传到了t+batch_size时刻。也就是产生了一个响应滞后。  \n",
    "理论上batch_size=sequence_length时，刚好可以用得到的hidden_state作为下一个batch的输入\n",
    "但是这样的batch运算还是有问题，batch和sequencelength越长 应该越有利于学习积分信息，而不是微分信息。  \n",
    "放大到512,20:41开始新一轮学习。\n",
    "训练的太慢了，而且发现不同人的同一个动作组差距也挺大的，准备试试同一个人的数据，数据集又小，收敛可能又快点。  512 跑了2epoch 几乎没收敛  \n",
    "观察了下，2-6个512的batch就可以完成动作切换。也就是500-1500ms 动作就可以切换，大约是1000-3000数据点 相关于sequence len 另外最好让输出的hidden(t)被尽快使用，减少积分压力？ 总之试试128也得\n",
    "128 loss小了很多，但是震荡峰值也不低，降低学习率看看。\n",
    "还是不行，训练集跟随正常，测试集一动不动\n",
    "一直过拟合，看到一个说法是我的网络可能过强了，导致记住了每一处细节，然后过拟合。\n",
    "删减了网络，好像还是不行\n",
    "思来想去觉得是batch还是大了，正如前面所说，动作切换的占比在数据集中极小，尝试减小batch增大这部分数据的利用率，权重更新频率提高应该更适合这种数据突变比较严重的。\n",
    "\n",
    "还是不太行，主要是训练集每次都一条直线，我认为需要归一化输出\n",
    "还是不行，但我感觉我又懂了\n",
    "## 2手动在输入参数中加上glove(t-len)到glove(t)\n",
    "通过上文出啊等你hiddenstate我发现一个误区 就是hidden state并不是保存了一个output状态，而是保存了input to output的一个基于时间的隐函数，而这个隐函数在反向传播的时候是会不断变化的。  \n",
    "简单来说如果sequence不够长，hiddenstate保存的就只是是output的变化斜率。这当然是不能起到传递glove作用的。同时，即便sequence特别长，能保存emg——>glove 在各种情况和时间下的映射，也并不能保存上一时间段的glove数据  \n",
    "另外这使我联想到基于IMU加速度数据的惯性导航系统。查阅了相关论文，发现他们手工输入了上一时间段估计的输出值。是在全连接层输入的，结构如下。  \n",
    "![图片](./pic/惯导模型.jpg)  \n",
    "手动输入了，彻底的失败，无非是人为引入了一个斜率，让训练集从水平线变成斜线了。痛苦\n",
    "\n",
    "## 另一个改进方案，通过对数据集重新划分，在动作0处截断，然后将0-*-0的区间打包，在dataloader中随机组合这些小包然后展开重新截取序列。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "#输出也进行归一化，不过取值区间人为指定。\n",
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "import os\n",
    "from scipy import interpolate\n",
    "from multiprocessing.dummy import Pool as ThreadPool\n",
    "\n",
    "dataDir = './EMG_data/thumb_scaled/normalization/'\n",
    "saveDir = './EMG_data/thumb_scaled/normalization/1/'\n",
    "\n",
    "def findAllMat():\n",
    "    \"\"\"\n",
    "    @description  :找到dataDir下所有的mat文件\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    for root,dirs,files in os.walk(dataDir):\n",
    "        for f in files:\n",
    "            if(f.split('.')[-1]==\"mat\"):\n",
    "                yield f\n",
    "def data_scaler(input_list):\n",
    "    \"\"\"\n",
    "    @description  :\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    scaler = MinMaxScaler(copy=False)\n",
    "    matData=input_list[0]\n",
    "    matFile=input_list[1]\n",
    "    norm_data={}\n",
    "    norm_data['glove'] = []\n",
    "\n",
    "    scaler.fit(matData['glove'])\n",
    "    norm_data['glove']=scaler.transform(matData['glove'])\n",
    "    matData['glove']=norm_data['glove']\n",
    "    sio.savemat(saveDir+matFile, matData)\n",
    "\n",
    "pool = ThreadPool()\n",
    "mat_list=[]\n",
    "for matFile in findAllMat(): \n",
    "    matData=sio.loadmat(dataDir+matFile)\n",
    "    mat_list.append([matData,matFile])\n",
    "results = pool.map(data_scaler, mat_list)\n",
    "pool.close()\n",
    "pool.join()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 标签分类\n",
    "目前的情况是很容易对某个动作过拟合，打算重新对数据集split 从rest动作的中点分开，然后随机打乱动作。不知道会不会好些。\n",
    "首先减少数据集，所以直接改datapreparation\n",
    "分开了，配合BN层，训练集到是可以很快收敛，但测试集就没效果，一条线。\n",
    "## 继续回到动作预测\n",
    "这次按照sequence拆出动作变化，利用TCN。输入上一个时间点的glove,输出下一个时间点的glove数据，与之前不同的是，输入的数据是实际的反馈数据，而不是网络生成的数据。\n",
    "还是不行····\n",
    "\n",
    "## 决定对数据降维\n",
    "首先通过动作图，确定原始数据集中动作1为伸屈拇指，单独将动作1扣取出来，再通过传感器分布可知，大拇指伸屈主要会影响传感器2 3 4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "import os\n",
    "from scipy import interpolate\n",
    "from multiprocessing.dummy import Pool as ThreadPool\n",
    "\n",
    "dataDir = './EMG_data/temp/'\n",
    "saveDir = './EMG_data/thumb_scaled/'\n",
    "\n",
    "def findAllMat():\n",
    "    \"\"\"\n",
    "    @description  :找到dataDir下所有的mat文件\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    for root,dirs,files in os.walk(dataDir):\n",
    "        for f in files:\n",
    "            if(f.split('.')[-1]==\"mat\"):\n",
    "                yield f\n",
    "def spliter(input_list):\n",
    "    \"\"\"\n",
    "    @description  :\n",
    "    ---------\n",
    "    @param  :\n",
    "    -------\n",
    "    @Returns  :\n",
    "    -------\n",
    "    \"\"\"\n",
    "    scaler = MinMaxScaler(copy=False)\n",
    "    matData=input_list[0]\n",
    "    matFile=input_list[1]\n",
    "\n",
    "    for i in range(len(matData['restimulus'])-1):\n",
    "        if(matData['restimulus'][i]==2):\n",
    "            index=i\n",
    "            break\n",
    "    matData['glove']=matData['glove'][:index-1000,1:4]\n",
    "    mlist=['emg','rerepetition','restimulus']\n",
    "    for i in range(0,3):\n",
    "        matData[mlist[i]]=matData[mlist[i]][:index-1000]\n",
    "    sio.savemat(saveDir+matFile, matData)\n",
    "\n",
    "pool = ThreadPool()\n",
    "mat_list=[]\n",
    "for matFile in findAllMat(): \n",
    "    matData=sio.loadmat(dataDir+matFile)\n",
    "    mat_list.append([matData,matFile])\n",
    "results = pool.map(spliter, mat_list)\n",
    "pool.close()\n",
    "pool.join()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 模型可视化\n",
    "    temp_dataset = mydp.MyDataSet(TRAIN_FILE_PATH + next(mydp.findAllMat(TRAIN_FILE_PATH)), sequence_length)\n",
    "    graph_inputs, _=temp_dataset.__getitem__(0)\n",
    "    graph_inputs=graph_inputs.repeat(batch_size,1,1).to(device)\n",
    "    writer.add_graph(model,graph_inputs)\n",
    "\n",
    "终端输入 tensorboard --logdir F:\\swap\\My\\runs\n",
    "# 相关性分析\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<function matplotlib.pyplot.show(close=None, block=None)>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUg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8bGDTG/NraqBa06Fxqm/kQ8Aurg5hLRG4Huowxh62O5VJSLeEnDRFxAT8CPmOMGbI6nggReRfQY4w5aHUsl+AErgP+rzHmWmAU65ciZoTXwW8n9ItpBZAvIu+3NqrFmVCNtm2vTkXk84SWRL9rdSyziUge8DfA31ody2JSLeF3AatnPV8V/pithEc9/gj4rjHmx1bHM8dNwLtF5BShJbG3iMij1oZ0kU6g0xgTeWX0OKFfAHaxE2g3xviMMdPAj4EbLY5pIefD86i5xFxqy4nIB4B3AX9k7HfzUC2hX+6Hwz83q4BDIlJpaVTzSLWEfwCoF5G1IpJFaKPsSYtjegMREUJrz8eMMV+yOp65jDGfM8asMsbUEPr3+40xxlZXp8aYc0CHiDSGP3QrcNTCkOY6A9wgInnh/+9bsdGm8hxLmUttKRF5G6ElxncbY8asjmcuY8yrxphyY0xN+OemE7gu/H1qKymV8MMbO58EfkXoB2yXMeZ31kZ1kZuA+whdOb8cfnuH1UEloU8B3xWRV4BNwBesDed14VcejwOHCM1ydmCDW+9F5PvAC0CjiHSKyJ+wwFxqm8X4VcANPBX+efmaDWNMCtpaQSml0kRKXeErpZRamCZ8pZRKE5rwlVIqTWjCV0qpNKEJXyml0oQmfKWUShOa8JVSKk38/8BvgqEh0WNfAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from pandas import DataFrame\n",
    "import matplotlib.pyplot as plt\n",
    "import scipy.io as sio\n",
    "import numpy as np\n",
    "import torch.nn as nn\n",
    "import torch\n",
    "matData=sio.loadmat(\"./EMG_data/thumb_scaled/normalization/S1_E1_A1.mat\")\n",
    "sensor_list=[]\n",
    "glove_list=[]\n",
    "for i in range(16):\n",
    "  sensor_num=\"emg_sensor\"+str(i)\n",
    "  sensor_list.append(sensor_num)\n",
    "for i in range(3):\n",
    "  sensor_num=\"glove_sensor\"+str(i)\n",
    "  glove_list.append(sensor_num) \n",
    "\n",
    "matData['emg']=matData['emg']-np.mean(matData['emg'], axis=0)\n",
    "matData['emg']=np.maximum(matData['emg'],-matData['emg'])\n",
    "\n",
    "pool1d=nn.MaxPool1d(kernel_size=101,stride=1,padding=50)\n",
    "output=pool1d(torch.from_numpy(matData['emg']).unsqueeze(0).permute(0,2,1))\n",
    "output=output.squeeze().permute(1,0)\n",
    "output=output.detach().numpy()\n",
    "\n",
    "spearman_value=[]\n",
    "for i in range(16):\n",
    "    data=DataFrame({'x':output[:,i],'y':matData['glove'][:,0]})\n",
    "    spearman_value.append(data.corr(method='spearman')['y'][0])\n",
    "plt.plot(spearman_value)\n",
    "plt.show\n",
    "\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<function matplotlib.pyplot.show(close=None, block=None)>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAi/klEQVR4nO3de3hV5Z0v8O9PrHpO1Y4dc6xVpmAPfUamtVZT2jmnt9NqRZ0jtWoHph0vbcd2HFp7nOlTqMpRdLweL63FCipiUUHEC3ci93sgAQIkIYEkJJAEkk1CLiTkun/nj70SdjZ7Jyt7r/v6fp6Hh73XXnut38pa+7fe9a53va+oKoiIKPjOcjsAIiJyBhM+EVFIMOETEYUEEz4RUUgw4RMRhcTZbq344osv1lGjRrm1eiIiX9q5c+dxVc1K57uuJfxRo0YhPz/frdUTEfmSiFSl+11W6RARhQQTPhFRSDDhExGFBBM+EVFIMOETEYUEEz4RUUgw4RMRhQQTvodEWjuRU3TM7TCIKKBMJXwRGS8ip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4RudeYdomqHjVeHwNwifE61TYPNr06yXSvcGI7U63DbZONqovZcVUOw93uvwbQpKo9CdMHLMv4vNmY33FG1cJXAGxHiPZ5wnYDHtvnfkv4QfENVb0GwI0A/k1EvhX/ocZO14FvL+vEdnrob/lnAJ8HcDWAowCeczUaG4nI+QDeB/AbVW2J/yzI+zzJdntun/st4ZsZUN3zVLXG+L8ewIcAxgGoE5FLAcD4v96YPdU2Dzb98iTTvcKJ7Uy1Dteoap2q9qpqFMCriO1zYPjb3QDgr0Tk7ITpA5ZlfP4pY37HiMgnEEt6b6vqB8bkwO/zZNvtxX3ut4RvZkB1TxORT4rIBX2vAXwfQCEGDgR/F2L1gDCm32m0aPg6gGbj0jUHwPdF5CLjUvH7iNXrHQXQIiJfN1ow3Bm3LC9wYjtTrcM1fcnIcCti+xyIxTrRaG0xGsAYxG5MJj3WjdLrOgC3G99P/Bv2bfftANYa8zvC2A+vA9ivqs/HfRTofZ5quz25z926sZHBDZGbELsLXg7gQbfjSSP+KxC7+74HQFHfNiBW77YGwEEAqwF82pguAGYY27sPQHbcsn4KoMz4d0/c9Gzj4CoH8Ce4dOMOwDzELmW7Eat3/JkT25lqHS5v91xju/YaP9JL4+Z/0NiGUsS1qEp1rBvH0A7j7/EegHON6ecZ78uMz69weLu/gVhVyl4ABca/m4K+zwfZbs/tc3atQEQUEn6r0iEiojQx4RMRhQQTPhFRSDDhExGFBBM+EVFIMOETEYUEEz4RUUj8f4rovCnmku8xAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from pandas import DataFrame\n",
    "import matplotlib.pyplot as plt\n",
    "import scipy.io as sio\n",
    "import numpy as np\n",
    "import torch.nn as nn\n",
    "import torch\n",
    "matData=sio.loadmat(\"./EMG_data/thumb_scaled/normalization/S1_E1_A1.mat\")\n",
    "matData['emg']=matData['emg']-np.mean(matData['emg'], axis=0)\n",
    "matData['emg']=np.maximum(matData['emg'],-matData['emg'])\n",
    "plt.plot(matData['emg'][:,0])\n",
    "plt.show"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "19d1d53a962d236aa061289c2ac16dc8e6d9648c89fe79f459ae9a3493bc67b4"
  },
  "kernelspec": {
   "display_name": "Python 3.9.12 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
